
import 'package:common_utils/common_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:cached_network_image/cached_network_image.dart';
import 'package:flutter_getx/ext/ext.dart';

class ImageUtils {

  static String getHolderImg(){
    return 'img_holder'.png;
  }

  static ImageProvider getImgProvider(String? imageUrl, {String? holderImg}) {
    if (TextUtil.isEmpty(imageUrl)) {
      return AssetImage(holderImg ?? getHolderImg());
    }
    return CachedNetworkImageProvider(imageUrl!);
  }

}